//
//  ZYHome.m
//  YiLin
//
//  Created by Zyark on 2018/6/8.
//  Copyright © 2018年 Zyark. All rights reserved.
//

#import "ZYHome.h"

@implementation ZYHome
+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"temperature" : @"roomTemp",
             @"pmExponent" : @"roomPm25",
             @"tvoc" : @"roomTvoc",
             @"humidity" : @"roomHumidity"
             };
}

-(NSString *)pmQuality{
    ZYChangeLanguage *language = [ZYChangeLanguage sharedZYChangeLanguage];
    NSInteger pmExponent = [_pmExponent integerValue];
    if(0 <= pmExponent && pmExponent <=12){
        return [language getStringByKey:LC_PM_QUALITY_EXCELLENT];
    }else if(12 <= pmExponent && pmExponent <=35){
        return [language getStringByKey:LC_PM_QUALITY_MEDIUM];
    }else if(35 < pmExponent && pmExponent <=55){
        return [language getStringByKey:LC_PM_QUALITY_MILD_POLLUTION];
    }else if(55 < pmExponent && pmExponent <=150){
        return [language getStringByKey:LC_PM_QUALITY_MODERATELY_POLLUTED];
    }else if(150 < pmExponent && pmExponent <=250){
        return [language getStringByKey:LC_PM_QUALITY_SEVERE_POLLUTION];
    }else{
        return [language getStringByKey:LC_PM_QUALITY_SERIOUS_POLLUTION];
    }
}

@end
